import './Domeform.scss'
import { useRef } from 'react';
const Domeform = (props) => {
  let dateVal=useRef(null)
  let titleVal=useRef(null)
  let priorityVal=useRef(null)
  const add=()=>{
    let data={
      date:dateVal.current.value,
      title:titleVal.current.value,
      priority:priorityVal.current.value
    }
    props.addKey(data)
  }
  return (
  <div className='Domeform'>
    <div className='Domeformbox'>
    <div className='date'>
        日期：<input type="date" ref={dateVal}/>
      </div>
      <div className='title'>
        标题：<input type="text" ref={titleVal}/>
      </div>
      <div className='priority'>
        优先级：<input type="text" ref={priorityVal}/>
      </div>
    </div>
      <button className='but' style={{width:80,height:50}} onClick={add}>添加</button>
  </div>
  );
}

export default Domeform;